//
//  CommentByLabel.m
//  ArtDog
//
//  Created by dllo on 16/9/6.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CommentByLabel.h"
#import "CommunityTopicList.h"
#import "CommentList.h"

@implementation CommentByLabel

- (void)setValue:(id)value forKey:(NSString *)key
{
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"commentList"]) {
        NSMutableArray<CommentList *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            CommentList * commentModel = [CommentList modelWithDic:dic];
            [array addObject:commentModel];
        }
        _commentList = array;
    }
    
    if ([key isEqualToString:@"topic"]) {
        CommunityTopicList *topicModel = [CommunityTopicList modelWithDic:value];
        _topic = topicModel;
    }
}

@end
